Move the about dialog to the glade file, add accessible tags examples to
authorJohan Dahlin <johan@gnome.org>
Tue, 29 Jan 2008 14:12:08 +0000 (14:12 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Tue, 29 Jan 2008 14:12:08 +0000 (14:12 +0000)
2008-01-29  Johan Dahlin  <johan@gnome.org>

* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
Move the about dialog to the glade file, add accessible tags
examples to the markup file.

svn path=/trunk/; revision=19426

ChangeLog
demos/gtk-demo/builder.c
demos/gtk-demo/demo.ui

index 9749f70d80ce252ef540bc2371def7f6f49531ab..cbe0fb39b9fce211614cad8c28d4fe1019bed9fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-29  Johan Dahlin,,,  <johan@gnome.org>
+
+       * demos/gtk-demo/builder.c: (quit_activate), (about_activate),
+       (do_builder):
+       * demos/gtk-demo/demo.ui:
+       Move the about dialog to the glade file, add accessible tags
+       examples to the markup file.
+
 2008-01-28  Paolo Borelli  <pborelli@katamail.com>
 
        * gtk/gtkprintunixdialog.c (draw_page_cb): do not leak the pango
index 8ffa6c46030f616a21103191850e554abf8b21fa..f62985a61725dc0b2fc56990098b3278783c1d2c 100644 (file)
@@ -6,9 +6,15 @@
 #include <gtk/gtk.h>
 #include "demo-common.h"
 
+static GtkBuilder *builder;
+
 void
 quit_activate (GtkAction *action)
 {
+  GtkWidget *window;
+
+  window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
+  gtk_widget_destroy (window);
 }
 
 void
@@ -16,18 +22,15 @@ about_activate (GtkAction *action)
 {
   GtkWidget *about_dlg;
 
-  about_dlg = gtk_about_dialog_new ();
-  gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about_dlg),
-                                     "GtkBuilder demo");
+  about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
   gtk_dialog_run (GTK_DIALOG (about_dlg));
-  gtk_widget_destroy (about_dlg);
+  gtk_widget_hide (about_dlg);
 }
 
 GtkWidget *
 do_builder (GtkWidget *do_widget)
 {
   static GtkWidget *window = NULL;
-  GtkBuilder *builder;
   GError *err = NULL;
   gchar *filename;
   
index a877223f0dcf850d59a189c8f0d69420e00ecd08..9d27c85cea8f52f10cee7a3bb9bf49745599aff8 100644 (file)
           </toolbar>
         </ui>
     </object>
-
+    <object class="GtkAboutDialog" id="aboutdialog1">
+        <property name="program-name" translatable="yes">GtkBuilder demo</property>
+         <accessibility>
+            <relation target="window1" type="subwindow-of"/>
+        </accessibility>
+    </object>
     <object class="GtkWindow" id="window1">
         <property name="default_height">250</property>
         <property name="default_width">440</property>
-        <property name="title">builder</property>
+        <property name="title">GtkBuilder demo</property>
         <child>
             <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
                 <child>
                     <object constructor="uimanager" class="GtkMenuBar" id="menubar1">
                         <property name="visible">True</property>
-                    </object>
+                       <child internal-child="accessible">
+                           <object class="AtkObject" id="a11y-menubar">
+                               <property name="AtkObject::accessible-name">The menubar</property>
+                           </object>
+                       </child>
+                   </object>
                     <packing>
                         <property name="expand">False</property>
                     </packing>
                 <child>
                     <object constructor="uimanager" class="GtkToolbar" id="toolbar1">
                         <property name="visible">True</property>
+                       <child internal-child="accessible">
+                           <object class="AtkObject" id="a11y-toolbar">
+                               <property name="AtkObject::accessible-name">The toolbar</property>
+                           </object>
+                       </child>
                     </object>
                     <packing>
                         <property name="expand">False</property>
                           <property name="visible">True</property>
                           <property name="model">liststore1</property>
                           <property name="tooltip-column">3</property>
+                         <child internal-child="accessible">
+                             <object class="AtkObject" id="a11y-treeview">
+                                 <property name="AtkObject::accessible-name">Name list</property>
+                                  <property name="AtkObject::accessible-description">
+                                    A list of person with name, surname and age columns
+                                  </property>
+                             </object>
+                         </child>
                           <child>
                             <object class="GtkTreeViewColumn" id="column1">
                               <property name="title">Name</property>
                           </child>
                         </object>
                       </child>
+                   <accessibility>
+                       <action action_name="move-cursor" description="Move the cursor to select another person."/>
+                   </accessibility>
                     </object>
                     <packing>
                         <property name="position">2</property>